﻿using Sprache;

namespace ExternalDSL.Initial
{
	public static class InitialParser
	{
		public static readonly Parser<string> Identifier = Parse.LetterOrDigit.AtLeastOnce().Text().Token();

		public static readonly Parser<string> QuotedText =
			(from open in Parse.Char('"')
			 from content in Parse.CharExcept('"').Many().Text()
			 from close in Parse.Char('"')
			 select content).Token();

		public static readonly Parser<Test> Test =
			from id in Identifier
			from quote in QuotedText
			select new Test(id, quote);
	}
}
